from django.shortcuts import render
from rest_framework.generics import ListAPIView, CreateAPIView
from apps.coupons.models import Coupon
from .serializers import CouponSerializer, MemberCouponsSerializer
from .models import MemberCoupons


# Create your views here.

class CouponsListViewSet(ListAPIView):
    # exclude ：排除满足条件的数据
    queryset = Coupon.objects.filter(delete=False).exclude(status=Coupon.NOT_START).order_by('-id')
    serializer_class = CouponSerializer


# class MemberCouponsViewSet(ListAPIView):
#     queryset = Coupon.objects.filter(delete=False).exclude(status=Coupon.NOT_START).order_by('-id')
#     serializer_class = CouponSerializer
